package com.feng.study.service;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class AsyncService {
    @Async
    public void asyncVoid() throws Exception {
        Thread.sleep(10000);
        System.out.println("3333.....");
        //异步方法执行出错，需要打印日志
        log.error("异步添加商品更新信息出错，需要手动回滚数据....");
        throw new Exception("异常");
    }
}
